#include <stdio.h>
#include <stdlib.h>
#include "calculator.h"

int main(int argc,char *argv[])
{

	if (argc < 2)
	{
		fprintf(stderr, "Usage:./main <expression>\n");
		exit(EXIT_FAILURE);
	}

	sqstack *num = stack_create();  //创建操作数栈
	sqstack *op = stack_create();   //创建运算符栈

	if (num == NULL || op == NULL)
	{
		fprintf(stderr, "stack_create() failed!\n");
		exit(EXIT_FAILURE);
	}

	int value = calculator(num, op, argv[1]);
	printf("value = %d\n", value);

	stack_destory(&num);
	stack_destory(&op);

	return 0;
}
